﻿<%--管理信息编辑页面--%>
<%@ Page Language="C#" MasterPageFile="Admin.master" %>
<%@ Register Src="../module/Types.ascx" TagName="Types" TagPrefix="inal" %>
<%@ Register Src="../module/Admincenter-Public-Laoding.ascx" TagName="Laoding" TagPrefix="inal" %>
<script runat="server">
    private int Admin_My_Id = 0;/* 当前操作管理员ID */
    private Admins admin_my;     /* 当前管理员 */
    private int Edit_Mode; /* 操作模式，0新增，1编制 */
    private int Obj_Admin_ID;  /* 对象管理员ID */
    private Admins admins;     /* 对象管理员 */
    private string Activation = "checked";
    
    protected void Page_Load(object sender, EventArgs e)
    {
        Admin_My_Id = Admins.IsLogin();
        admin_my = new Admins(Admin_My_Id);
        Edit_Mode = Utils.GetQueryString("edit_mode", 0);
        Obj_Admin_ID = Utils.GetQueryString("id", 0);
        /* 如果是编辑模式，读取信息，绑定组件 */
        admins = new Admins(Obj_Admin_ID);
        /* 绑定特殊属性 */
        if (admins.Activation == 0)
            Activation = "";
    }
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        /* 绑定管理员分类组 */
        $(document).ready(function () {
            $("#Typ31_0").val(<%=admins.Admin_Group %>);
        });
        /* 输入法激活 */
        bedit_allow = "Admin_Name:Admin_Remark:Admin_Introduction";
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <%=Lang.Show("Admin") %> - <%if (Edit_Mode == 0){ %> <%=Lang.Show("Add") %><%} else { %><%=Lang.Show("Edit") %><%} %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <%if (Edit_Mode == 0){%><img class="admin_user_logo" src="../static/img/Admin/user-male-circle-vector.png" />
    <%}else{ %><img class="admin_user_logo" src="../DataFile/admins/<%=admins.Create_Time.ToString("yyyyMM") %>/<%=admins.Create_Time.ToString("ddHHmmss") %>_s.jpg" /><%} %>
    <table class="inputs admininfo">
        <tr>
            <td><%=Lang.Show("AdminId") %> :</td>
            <td><input id="Admin_Id" class="num t_c en" type="number" max="9999" min="100" <%if(Edit_Mode==1){ %>disabled="disabled"<%} %>  value="<%=Obj_Admin_ID %>" maxlength="4" /></td>
            <td><div id="Validate-Admin_Id"></div></td>
        </tr>
        <tr>
            <td><%=Lang.Show("AdminGroup") %> :</td>
            <td><inal:Types runat="server" Type="31" /></td>
            <td><div id="Validate-Typ31_0"></div></td>
        </tr>
        <tr>
            <td><%=Lang.Show("Name") %> :</td>
            <td><input id="Admin_Name" name="Admin_Name" value="<%=admins.Admin_Name %>" maxlength="80" /></td>
            <td><div id="Validate-Admin_Name"></div></td>
        </tr>
        <tr>
            <td><%=Lang.Show("AdminLevel") %> :</td>
            <td><input id="Admin_Level" class="num t_c en" type="number" max="<%=admin_my.Admin_Level %>" min="1" value="<%=admins.Admin_Level %>" /><output name="x" for="Admin_Level"></output></td>
            <td><div id="Validate-Admin_Level"></div></td>
        </tr>
        <tr>
            <td><%=Lang.Show("Activation") %> :</td>
            <!--slideThree 特殊选择器-->
            <td><div class="slideThree"><input type="checkbox" value="None" id="Activation" name="check" <%=Activation %>  /><label for="Activation"></label></div></td>
            <td></td>
        </tr>
        <tr>
            <td><%=Lang.Show("IpArea") %> :</td>
            <td><input class="en t_c" id="IP_Area" placeholder="*.*.*.* (ip4)" title="<%=Lang.Show("IpArea") %>" value="<%=admins.IP_Area %>" /></td>
            <td><div id="Validate-IP_Area"></div></td>
        </tr>
        <tr>
            <td></td>
            <td><div class="c_h"></div></td>
            <td></td>
        </tr>
        <tr>
            <td><%=Lang.Show("CookieTime") %> :</td>
            <td><input id="Cookie_Time" class="num t_c en" type="number" max="254" min="1" value="60" /></td>
            <td></td>
        </tr>
        <tr>
            <td><%=Lang.Show("Remark") %> :</td>
            <td><textarea id="Admin_Remark" name="Admin_Remark" rows="4"><%=admins.Admin_Remark %></textarea></td>
            <td></td>
        </tr>
        <tr>
            <td><%=Lang.Show("Introduction") %> :</td>
            <td><textarea id="Admin_Introduction" name="Admin_Introduction" rows="4"><%=admins.Admin_Introduction %></textarea></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td><div class="c_h"></div></td>
            <td></td>
        </tr>
        <tr>
            <td><%=Lang.Show("Email") %> :</td>
            <td><input id="Admin_Email"  class=" t_c en" placeholder="admin@izbol.com" type="email" value="<%=admins.Admin_Email %>"  /></td>
            <td></td>
        </tr>
        <tr>
            <td><%=Lang.Show("OfficeTel") %> :</td>
            <td><input id="Admin_Office_Tel"  class=" t_c en" placeholder="<%=Lang.ShowPublic("OfficeTel1") %>" type="tel" value="<%=admins.Admin_Office_Tel %>"   /></td>
            <td></td>
        </tr>
        <tr>
            <td><%=Lang.Show("phone") %> :</td>
            <td><input id="Admin_Phone"  class=" t_c en" type="tel" placeholder="<%=Lang.ShowPublic("Phone1") %>" value="<%=admins.Admin_Phone %>"   /></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td><button onclick="Admin_AddEdit(<%=Edit_Mode %>)"  class="button"><%=Lang.Show("Submit") %></button></td>
            <td></td>
        </tr>
    </table>
    <inal:Laoding runat="server" />


    <script type="text/javascript">
        ShowLimitLength(48, "Admin_Id");
        ShowLimitLength(48, "Admin_Name");
        ShowLimitMaxMinValue("#Admin_Level",1,<%=admin_my.Admin_Level %>);
        ShowLimitMaxMinValue("#Cookie_Time",1,254);
        
    </script>
</asp:Content>

